﻿// --------------------------------------------------------------------------------------------------------------------- 
// <copyright file="NavigationSetting.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Defines the NavigationSetting type.
// </summary>
// ---------------------------------------------------------------------------------------------------------------------
namespace Collaboris.Saf.Actions.Moss.Entities
{
    using System;
    using System.Xml.Serialization;

    using SharePoint.Wss.Attributes;
    using SharePoint.Wss.Entities;

    [Serializable]
    [CollaborisClass(Title = "Navigation Setting",
        ReleaseStatus = ReleaseStatus.Beta,
        Summary = "Defines the parameters to amend the current and/or global navigation from the current web.")]
    public class NavigationSetting : WSSEntityBase
    {
        private bool? applyTocurrentNavigation;
        private bool? applyToglobalNavigation;        
        private NavigationAction? sitesAction;
        private NavigationAction? pagesAction;

        
        [CollaborisProperty(
                    Summary = "Specifies whether to apply the settings to the 'Global Navigation'.",
                    Title = "Apply to Global Nav",
                    Required = false,
                    Example = "true",
                    Remarks = "The 'Global Navigation' usually refers to the top menu.",
                    InputHint = InputHint.NullableBoolean)]
        [XmlElement(IsNullable = true)]
        public bool? ApplyToGlobalNav
        {
            get
            {
                return this.applyToglobalNavigation;
            }

            set
            {
                this.applyToglobalNavigation = value;
            }
        }

        [CollaborisProperty(
                    Summary = "Specifies whether to apply the settings to the 'Current Navigation'.",
                    Title = "Apply to Current Nav",
                    Required = false,
                    Example = "true",
                    Remarks = "The 'Current Navigation' refers to the menu for the current site.",
                    InputHint = InputHint.NullableBoolean)]
        [XmlElement(IsNullable = true)]
        public bool? ApplyToCurrentNav
        {
            get
            {
                return this.applyTocurrentNavigation;
            }

            set
            {
                this.applyTocurrentNavigation = value;
            }
        }

        [CollaborisProperty(
                    Summary = "Specifies whether how apply the settings to the pages.",
                    Title = "Pages Action",
                    Required = false,
                    Example = "ExcludeFromNav",
                    Remarks = "Possible values are 'DoNothing' | 'IncludeInNav' | 'ExcludeFromNav'",
                    InputHint = InputHint.NullableEnum)]
        [XmlElement(IsNullable = true)]
        public NavigationAction? PagesAction
        {
            get
            {
                return this.pagesAction;
            }

            set
            {
                this.pagesAction = value;
            }
        }

        [CollaborisProperty(
                  Summary = "Specifies how to apply the settings to sites.",
                  Title = "Sites Action",
                  Required = false,
                  Example = "ExcludeFromNav",
                  Remarks = "Possible values are 'DoNothing' | 'IncludeInNav' | 'ExcludeFromNav'",
                  InputHint = InputHint.NullableEnum)]
        [XmlElement(IsNullable = true)]
        public NavigationAction? SitesAction 
        {
            get
            {
                return this.sitesAction;
            }

            set
            {
                this.sitesAction = value;
            }
        }
    }

    /// <summary>
    /// Describes what action to take with the Navigation for the web.
    /// </summary>
    public enum NavigationAction 
    { 
        /// <summary>
        /// Make no change the Webs Navigation
        /// </summary>
        DoNothing,

        /// <summary>
        /// IncludeInNav the Web in the Navigation
        /// </summary>
        IncludeInNav,

        /// <summary>
        /// ExcludeFromNav the Web in the Naviagtion
        /// </summary>
        ExcludeFromNav
    }
}